package wn.tcpip.socket.netty.jdbc;/**
 * Created by zhangqin on 2017/7/6.
 */

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 数据库操作
 *
 * @author
 * @create 2017-07-06 15:44
 **/
@Component
public class NettyJdbcTool {
    @Resource
    private JdbcTemplate jdbcTemplate;
    public  boolean hasImei(String im){
        Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap("select count(imei) c from  wn_dwsb where imei=?", im);
        return Integer.parseInt(stringObjectMap.get("c").toString())>0;
    }
}
